package com.xb.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.xb.model.domain.entity.CustomerService;
import com.xb.system.mapper.db1.CustomerServiceMapper;
import com.xb.system.service.CustomerServiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.concurrent.TimeUnit;

@Service
public class CustomerServiceServiceImpl extends ServiceImpl<CustomerServiceMapper, CustomerService>
        implements CustomerServiceService {

    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    private static final String CUSTOMER_SERVICE_CACHE_KEY = "customer_service_info";

    @Override
    public CustomerService getCustomerServiceInfo() {
        CustomerService customerService = this.getById(1L);
        return customerService;
    }

    @Override
    public boolean updateCustomerService(CustomerService customerService) {
        boolean updated = this.updateById(customerService);
        return updated;
    }
}